/*
 * Created by Christopher King
 * Copyright (C) 2007 Christopher King, All Rights Reserved.
 */

package us.cirion.adventure.engine.result;

import us.cirion.adventure.engine.Noun;
import us.cirion.adventure.engine.Nowhere;
import us.cirion.adventure.engine.Result;

/**
 * Destroys an item, removing it from the game.
 * 
 * @author Chris
 */
public class DestroyItem implements Result
{

	public Noun item;

	/**
	 * Generates a command to destroy an item.
	 * 
	 * @param item The item to be removed.
	 */
	public DestroyItem(Noun item)
	{
		this.item = item;
	}

	/**
	 * Removes the item.
	 */
	public void execute()
	{
		item.getLocation().removeItem(item);
		item.setLocation(Nowhere.getInstance());
	}

}
